package com.yq.testmodule.view

import android.content.Context
import android.util.AttributeSet
import android.view.MotionEvent
import android.widget.LinearLayout
import com.fmt.mvi.learn.gobal.log

class CustomLineLayoutC @JvmOverloads constructor(
    context: Context, attrs: AttributeSet? = null, defStyleAttr: Int = 0
) : LinearLayout(context, attrs, defStyleAttr) {

    val TAG = "C"

    override fun dispatchTouchEvent(ev: MotionEvent?): Boolean {
        val dispatchTouchEvent = super.dispatchTouchEvent(ev)
        "$TAG(${ev?.action}):  dispatchTouchEvent return : ${dispatchTouchEvent}".log()
        return dispatchTouchEvent
    }

    override fun onTouchEvent(event: MotionEvent?): Boolean {
        val onTouchEvent = super.onTouchEvent(event)
//        val onTouchEvent = true
        "$TAG(${event?.action}):  onTouchEvent return :${onTouchEvent}".log()
        return onTouchEvent
    }

    override fun onInterceptTouchEvent(ev: MotionEvent?): Boolean {
        val onInterceptTouchEvent = super.onInterceptTouchEvent(ev)
        "$TAG(${ev?.action}):  onInterceptTouchEvent return :${onInterceptTouchEvent}".log()
        return onInterceptTouchEvent
    }
}